//
//  NetWorkingTool.m
//  UI_豆瓣
//
//  Created by WangZe on 15/10/12.
//  Copyright © 2015年 王泽龙. All rights reserved.
//

#import "NetWorkingTool.h"

@implementation NetWorkingTool
+ (void)getNetWorking:(NSString *)strURL block:(Block)block
{
    NSURL *url = [NSURL URLWithString:strURL];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
        id result = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
        block(result);
    }];
    
}
@end
